// pages/home/home.js
var order = ['red', 'yellow', 'blue', 'green', 'red']
Page({

  /**
   * 页面的初始数据
   */
  data: {
    imgUrls: [
      'http://wlsqbucket.img-cn-shenzhen.aliyuncs.com/wlsq/shop/carousel_img/20170427164556525238.jpg?x-oss-process=image/resize,m_fixed,h_432,w_768,limit_0',
      'http://wlsqbucket.img-cn-shenzhen.aliyuncs.com/wlsq/shop/carousel_img/2017051709381233477.jpg?x-oss-process=image/resize,m_fixed,h_432,w_768,limit_0',
      'http://wlsqbucket.img-cn-shenzhen.aliyuncs.com/wlsq/shop/carousel_img/2017051709381233477.jpg?x-oss-process=image/resize,m_fixed,h_432,w_768,limit_0',
      'http://wlsqbucket.img-cn-shenzhen.aliyuncs.com/wlsq/shop/carousel_img/2017051709381233477.jpg?x-oss-process=image/resize,m_fixed,h_432,w_768,limit_0'
    ],
    m3_tabs: [
      { id: '1', name: '精选' },
      { id: '2', name: '家居' },
      { id: '3', name: '食品' },
      { id: '4', name: '美妆' },
      { id: '5', name: '母婴' },
      { id: '6', name: '数码家电' },
      { id: '7', name: '服饰鞋包' }
    ],
    indicatorDots: true,
    autoplay: true,
    _num: '1',
    interval: 3000,
    duration: 1000,
    m1ProList: [
      {
        imgUrl: "http://wlsqbucket.img-cn-shenzhen.aliyuncs.com/wlsq/shop/goods_img/20170427165224606877.jpg?x-oss-process=image/resize,     m_fixed,h_200,w_200,limit_0",
        desc: "此商品为测试商品，请勿购买！",
        price: "191.00",
        profit: "200.00"
      },
      {
        imgUrl: "http://wlsqbucket.img-cn-shenzhen.aliyuncs.com/wlsq/shop/goods_img/2017042716542426605.jpg?x-oss-process=image/resize,m_fixed,h_200,w_200,limit_0",
        desc: "此商品为测试商品，请勿购买！",
        price: "192.00",
        profit: "100.00"
      },
      {
        imgUrl: "http://wlsqbucket.img-cn-shenzhen.aliyuncs.com/wlsq/shop/goods_img/2017042716554866758.jpg?x-oss-process=image/resize,m_fixed,h_200,w_200,limit_0",
        desc: "此商品为测试商品，请勿购买！",
        price: "193.00",
        profit: "100.00"
      },
      {
        imgUrl: "http://wlsqbucket.img-cn-shenzhen.aliyuncs.com/wlsq/shop/goods_img/20170427165728378825.jpg?x-oss-process=image/resize,m_fixed,h_200,w_200,limit_0",
        desc: "此商品为测试商品，请勿购买！",
        price: "194.00",
        profit: "100.00"
      },
      {
        imgUrl: "http://wlsqbucket.img-cn-shenzhen.aliyuncs.com/wlsq/shop/goods_img/20170427165622781255.jpg?x-oss-process=image/resize,m_fixed,h_200,w_200,limit_0",
        desc: "此商品为测试商品，请勿购买！",
        price: "195.00",
        profit: "100.00"
      },
      {
        imgUrl: "http://wlsqbucket.img-cn-shenzhen.aliyuncs.com/wlsq/shop/goods_img/2017060210580241548.jpg?x-oss-process=image/resize,m_fixed,h_200,w_200,limit_0",
        desc: "此商品为测试商品，请勿购买！",
        price: "196.00",
        profit: "100.00"
      }
    ]
  },
  // tabs切换
  menuClick: function (e) {
    this.setData({
      _num: e.target.dataset.num
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    console.log('刷新');
    wx.showNavigationBarLoading(); //在标题栏中显示加载
    //模拟加载
    setTimeout(function () {
      // complete
      wx.hideNavigationBarLoading() //完成停止加载
      wx.stopPullDownRefresh() //停止下拉刷新
    }, 1500);
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})